//
import { request } from "@/utils/request";
// 机房--------------------
// 获取机房
export function getMachineRoom(params) {
  return request({
    url: "/overview/getMachineRoom",
    method: "GET",
    params,
  });
}

// 获取机房信息
export function getMachineRoomInfo(params) {
  return request({
    url: "/overview/queryRoomCabinetListAllByTypeParam",
    method: "GET",
    params,
  });
}

// 机房概览定时刷新
export function totalCurrentData(data) {
  return request({
    url: "/monitor/totalCurrentData",
    method: "POST",
    data,
    type: 2,
  });
}

// 获取告警
export function getAlertList(params) {
  return request({
    url: "/overview/getAlertList",
    method: "GET",
    params,
  });
}

// 获取机柜详情
export function getCabinetDetail(params) {
  return request({
    url: "/overview/queryCabinetDetailByResourceId",
    method: "GET",
    params,
  });
}

// 查询机房动力环境信息 和 网络设备信息 列表
export function getEnvironmentRoomList(params) {
  return request({
    url: "/overview/getEnvironmentRoomList",
    method: "GET",
    params,
  });
}

// 按资源名或者主机名称查询
export function searchResource(params) {
  return request({
    url: "/overview/selectNormalResource",
    method: "GET",
    params,
  });
}

// 告警信息一键确认
export function alterConfirm(params) {
  return request({
    url: "/overview/AlterConfirm",
    method: "GET",
    params,
  });
}

// 可分配机位资产列表查询
export function getAssetList(params) {
  return request({
    url: "/monitor/getAssetList",
    method: "GET",
    params,
  });
}

// 管理信息
export function getManagementInformation(params) {
  return request({
    url: "/monitor/getManagementInformation",
    method: "GET",
    params,
  });
}

// 查询可机位分配的机柜信息
export function seatAllocation(params) {
  return request({
    url: "/monitor/seatAllocation",
    method: "GET",
    params,
  });
}

// 查询可机位分配的机柜列表
export function getAllocationList(params) {
  return request({
    url: "/monitor/getCatinetAllocationList",
    method: "GET",
    params,
  });
}

// ----------------------资产监视

// 查询告警信息列表
export function getAlterListByResourceId(params) {
  return request({
    url: "/monitor/getAlterListByResourceId",
    method: "GET",
    params,
  });
}

// 历史曲线
export function getHistoryDate(params) {
  return request({
    url: "/monitor/historicalCurveData",
    method: "GET",
    params,
  });
}

// 历史曲线选项数据
export function historyCureItem(params) {
  return request({
    url: "/monitor/historyCureItem",
    method: "GET",
    params,
  });
}

// 资产详情,动态数据
export function getMonitorData(params) {
  return request({
    url: "/monitor/getMonitorData",
    method: "GET",
    params,
  });
}

// 资产详情,静态数据
export function getMonitorStaticDetail(params) {
  return request({
    url: "/monitor/getMonitorStaticDetail",
    method: "GET",
    params,
  });
}

// 资产顶部详情
export function getAssetsDetail(params) {
  return request({
    url: "/monitor/getAssetsDetail",
    method: "GET",
    params,
  });
}
// -------------机柜分配------------------------------

// 机柜分配资产卡片详情信息
export function getAssetDetail(params) {
  return request({
    url: "/monitor/getAssetDetail",
    method: "GET",
    params,
  });
}
// 机柜分配（3个机柜）列表
export function getDetailList(params) {
  return request({
    url: "/monitor/getDetailList",
    method: "GET",
    params,
  });
}

// 机位分配
export function asseAllocation(data) {
  return request({
    url: "/monitor/asseAllocation",
    method: "POST",
    data,
    type: 2,
  });
}
// 获取拓扑图
export function topo(params) {
  return request({
    url: "/Alarm/topo",
    method: "GET",
    params,
  });
}
